package com.zzr.zzrbackend.controller;

import com.zzr.zzrbackend.pojo.dto.CommonResult;
import com.zzr.zzrbackend.pojo.dto.param.AudioInitParam;
import com.zzr.zzrbackend.pojo.dto.result.NoData;
import com.zzr.zzrbackend.service.AudioService;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;



@RestController
public class AudioController {

    @Resource
    private AudioService audioService;

    @RequestMapping(value = "/api/audio/init", method = RequestMethod.POST)
    public CommonResult<NoData> setAudioInit(HttpServletRequest request, @RequestBody AudioInitParam audioInitParam) {
        return audioService.setAudioInit(request, audioInitParam);
    }

    @RequestMapping(value = "/api/audio/server", method = RequestMethod.GET)
    public CommonResult<NoData> getServer(HttpServletRequest request) {
        return audioService.getServer(request);
    }

    @RequestMapping(value = "/api/audio/ai-cache", method = RequestMethod.GET)
    public CommonResult<NoData> getAiAudioCache(HttpServletRequest request, Integer contentInfoId) {
        return audioService.getAiCache(request, contentInfoId);
    }

    @RequestMapping(value = "/api/mouse/server", method = RequestMethod.GET)
    public CommonResult<NoData> getMouseServer(HttpServletRequest request) {
        return audioService.getMouseServer(request);
    }
}
